import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

import Http from 'network/request.js'


const store = new Vuex.Store({
	state: {
		userInfo: '',  
	},
	mutations: { 
		setUserInfo(state, data) {
			state.userInfo = data;
		},   
	},
	actions: {
		getUserInfo(){
			Http({
				url:'/sso/info',
				method:'get'
			}).then(data=>{
				this.commit('setUserInfo', data);
			})
		},   
	}
})
export default store